home *** CD-ROM | disk | FTP | other *** search
/ Aminet 44 / Aminet 44 (2001)(GTI - Schatztruhe)[!][Aug 2001].iso / Aminet / util / wb / NewHomer.lha / NewHomer / install next >
Text File  |  2001-05-26  |  6KB  |  161 lines

  1. ; $VER: New Homer Installer 1.0 (14.05.01)
  2.  
  3. ;
  4. ; Notice: this installer was derived from the original Homer installer...
  5. ; I did this since I had NEVER used the commodore installer before, so I
  6. ; wanted to lose as less time as possible.
  7. ;
  8.  
  9. ; =======================================================================
  10. ;   Set up some variables
  11. ; =======================================================================
  12.  
  13. (set OSVersion       (/ (getversion) 65536))
  14. (set WBVersion       (/ (getversion "libs:version.library") 65536))
  15. (set AGVersion       (/ (getversion "libs:amigaguide.library") 65536))
  16. (set cpu             (database "cpu"))
  17. (set #welcome        "\nNewHomer 1.1 @2001 Emiliano Esposito\nWelcome to New Homer installation program.\n\nNew Homer is a (bit better) replacement for old Homer 1.6 found on Aminet.\nNB be sure to read the install part of documentation before installing.\n")
  18.  
  19. (message #welcome)
  20. (welcome)
  21.  
  22. ;
  23. ; ===== English
  24. ;
  25. (set #kickstart "\nERROR : BAD VERSION OF KICKSTART\n\nHomer requires KickStart %s (V%ld) or higher. It will not work on earlier versions.\nYou currently are running KickStart V%ld.\n\n%s")
  26. (set #goodbye "\nHave fun with Homer!\nIf you want, send any bug-reports, comments, or suggestions to:\nEmiliano Esposito - eesposito@usa.net\n")
  27. (set #continue "Continue with installation?")
  28. (set #aborted "Installation aborted!")
  29. (set #askfile "Please choose the NewHomerDATA.lha file\n")
  30. (set #askfile-help "You need some data files (samples+appropriate config) in order to use Homer. If you didn't have old Homer 1.x installed (and this seems to be the case), you need an extra file called "NewHomerDATA.lha". If you downloaded it, please choose it now.\n")
  31. (set #yes "Yes")
  32. (set #no "No")
  33. (set #which-disk "Choose the directory where your Homer 1.x was installed,\nor where you want to create a new Homer directory.\n\n(ie if your old Homer was installed in Work:Homer, you must choose Work:, NOT Work:homer)")
  34. (set #which-disk-help "If you are reading this, you probably didn't read the guide file... or you are new to Amiga and the latter sounds too strange nowadays! ;))\n\n")
  35. (set #doc-which-disk "Select directory to install documentation to")
  36.  
  37. ;*** starting actions
  38. (set #acpr "Please choose what sort of installation do you want to perform for Homer")
  39. (set #ch1 "Install over old Homer1.5/1.6 and keep old files")
  40. (set #ch2 "Install over old Homer1.5/1.6 and replace old files")
  41. (set #ch3 "New installation (can use one of NewHomer_DATA.lha or NewHomer_DATA_ITA.lha files.)")
  42.  
  43. ;*** Messages
  44. (set #msg_tooltypes "Setting tool types for current setup...")
  45. (set #exec-msg "About to execute the following command:\n")
  46.  
  47. ;*** Errors
  48. (set #err_CantMakeDirectory "An error has occured creating the Homer directory. Please check that the path you specified for installation to is valid!")
  49. (set #err_CantFindDirectory "The path you specified to install to was not located. Please check that the path you specified for installation to is valid!")
  50.  
  51. ; =======================================================================
  52. ;   Initialization
  53. ; =======================================================================
  54.  
  55. ; ===== Make sure that we are running under the correct version of kickstart
  56. (complete 0)(working #working_kickstart)
  57. (set #minver-text (cat "2.1") )
  58. (set minver 38)
  59.  
  60. (if (< OSVersion minver)
  61.    (
  62.    (set warning (#kickstart #minver-text minver OSVersion #aborted) )
  63.    (abort warning)
  64.    )
  65. )
  66.  
  67.  
  68. (if ( exists "Work:" (noreq) )
  69.    (set @default-dest "Work:")
  70.    (if ( exists "Sys:" (noreq) )
  71.       (set @default-dest "Sys:")
  72.    )
  73. )
  74.  
  75. (complete 0)
  76.  
  77. ;
  78. ; select what type of action to perform
  79. ;
  80.  
  81. (set insttype (askchoice (prompt #acpr)
  82.               (help "D'OH!\n" @askchoice-help)
  83.               (choices #ch1 #ch2 #ch3)
  84.               (default 0)
  85.    )
  86. )
  87.  
  88. ; =======================================================================
  89. ;   Select target directory
  90. ; =======================================================================
  91. (set target
  92.     (askdir (prompt #which-disk)
  93.         (help #which-disk-help @askdir-help)
  94.         (default @default-dest)
  95.     )
  96. )
  97.  
  98. (copyfiles (source "NewHomer") (dest "RAM:T/Homer"))
  99. (copyfiles (source "NewHomer.info") (dest "RAM:T/Homer"))
  100. (copyfiles (source "NewHomer.guide") (dest "RAM:T/Homer"))
  101.  
  102. (complete 25)
  103.  
  104. (set target (tackon target "Homer" ) )
  105. (makedir target (infos) )
  106. (makeassign "Homer" target (safe))
  107.  
  108. (if (= insttype 1)
  109.    (
  110.       (rename "RAM:T/Homer/NewHomer" "RAM:T/Homer/Homer")
  111.       (rename "RAM:T/Homer/NewHomer.info" "RAM:T/Homer/Homer.info")
  112.       (rename "RAM:T/Homer/NewHomer.conf" "RAM:T/Homer/Homer.conf")
  113.    )
  114. )
  115.  
  116. (if (= insttype 2)
  117.    (
  118.       (set datafile
  119.          (askfile (prompt #askfile)
  120.                   (help #askfile-help @askfile-help)
  121.                   (default "NewHomer_DATA.lha")
  122.          )
  123.       )
  124.       (set #cmd ('c:lha x "%s" "%s/"' datafile target) )
  125.       (message #exec-msg '"' #cmd '"' )
  126.       (run #cmd )
  127.    )
  128. )
  129.  
  130. (complete 50)
  131.  
  132. (message "About to copy Homer files to chosen destination. Click proceed to confirm action.")
  133. (copyfiles (source "RAM:T/Homer") (dest target) (all))
  134.  
  135. (complete 95)(working #msg_tooltypes)     ; ===== Change icon tool types
  136.  
  137. ;(message "About to copy Titlebar.image to sys:classes/images")
  138. ;(copyfiles (source "titlebar.image") (dest "sys:classes/images"))
  139.  
  140. (if (= insttype 1)
  141.    (tooltype   (dest "Homer:Homer")
  142.       (settooltype "PROGDIR" target )
  143.       (settooltype "CONFIG" "Homer.conf")
  144.    )
  145.    (
  146.       (tooltype   (dest "Homer:NewHomer")
  147.          (settooltype "PROGDIR" target )
  148.          (if (= insttype 2)
  149.             (settooltype "CONFIG" "NewHomer.conf")
  150.             (settooltype "CONFIG" "Homer.conf")
  151.          )
  152.       )
  153.    )
  154. )
  155.  
  156. (complete 100)
  157.  
  158. (makeassign "Homer" (safe))
  159.  
  160. (exit #goodbye)
  161.